package com.mock.ems.redis;

import redis.clients.jedis.JedisPubSub;
import redis.clients.jedis.Tuple;

import java.util.List;
import java.util.Set;

public interface RedisHandler {
	
	
	public Long zadd(String key, Double score, String member);
	
	public void zremrangeByRank(String key, Long start, Long end);
	
	public void zincrby(String key, Double score, String member);
	
	public Long zcard(String key);
	
	public Set<String> zrange(String key, Long start, Long end);
	
	public Set<String> zrevrange(String key, Long start, Long end);
	
	public Long zrank(String key, String member);
	
	public Long zrevrank(String key, String member);
	
	/** 
	* @Title: zrevrangeWithScores 
	* @Description: 获取ZSET中的Score和Member
	* @param key
	* @param start
	* @param end
	* @return Set<Tuple>
	* @throws 
	*/
	public Set<Tuple> zrevrangeWithScores(String key, Long start, Long end);
	
	public Double zscore(String key, String member);
	
	public Long zrem(String key, String... member);
	
	
	
	public boolean set(String key, Object val);
	
	public boolean del(String key);
	
	public Boolean set(String key, String val, Integer timeToLive);
	
	public Boolean set(String key, Object val, Integer timeToLive);
	
	public <T> T get(String key, Class<T> clazz);
	
	public Long incr(String key, Long offset);
	
	public Long decr(String key, Long offset);
	
	public boolean expiredAt(String key, Long unixTime);
	
	public boolean expired(String key, Integer timeToLive);
	
	public Long rpush(String key, String... elements);
	
	public List<String> lrange(String key, Long start, Long end);
	
	public Long lrem(String key, String element);
	
	public boolean setnx(String key, String value);
	
	public boolean hset(String key, String field, String value);
	
	public Long hincrby(String key, String field, Long value);
	
	public Double hincrbyfloat(String key, String field, Double value);
	
	public boolean hdel(String key, String... fields);
	
	public String hget(String key, String field);
	
	public List<String> hmget(String key, String... fields);
	
	public Set<String> hkeys(String key);
	
	public List<String> hvals(String key);
	
	public List<String> blpop(int timeout, String key);
	
	public Long publish(String channel, String message);
	
	public void subscribe(JedisPubSub jedisPubSub, String... channels);
	
	public Double incrByFloat(String key, Double value);
	
	public Set<String> zrangeByScore(String key, double min, double max);
	
	
	
}
